package com.cw.demo.controller;

import com.cw.demo.model.Emp;
import com.cw.demo.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController

public class IndexController {
    @Autowired

    private DeptService deptService;
    @RequestMapping("/findDept.do")
    @ResponseBody
    public List<Emp> testString(Emp emp)
    {
        System.out.println(emp);
        List<Emp> list=deptService.findByParam(emp);
        return list;
    }
}
